﻿using System;
using System.Windows.Forms;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using YArchitech.Revit;

namespace YArchitech.Plumbing
{
	[Transaction(TransactionMode.Manual)]
	public class ReadData : IExternalCommand
	{
		public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
		{
			UIDocument activeUIDocument = commandData.Application.ActiveUIDocument;
			Document document = activeUIDocument.Document;
			SelectedElement selectedElement = activeUIDocument.PickElementsByPoint("选择一个点", 0.05);
			SetSanitaryData setSanitaryData = YJKRevitTools.GetSetSanitaryData(document, selectedElement.Element);
			MessageBox.Show(setSanitaryData.ColdPoint.ToString());
			MessageBox.Show(setSanitaryData.ColdOffset.ToString());
			return Autodesk.Revit.UI.Result.Succeeded;
		}
	}
}
